package procilege.lang;

public class PredicateEntityProperty implements PredicatePropertyExpr {

	private Name entity;

	private String property;

	public PredicateEntityProperty(Name object, String property,
			ScopeBlock scope) {

		this.entity = object;
		this.property = property;
	}

	public Name getEntity() {
		return entity;
	}

	public String getProperty() {
		return property;
	}

	public BoolExprOr norm() {

		BoolExprOr orExpr = new BoolExprOr();
		BoolExprAnd andExpr = new BoolExprAnd();
		andExpr.and((PredicateEntityProperty) this.clone());
		orExpr.or(andExpr);

		return orExpr;
	}

	public Object clone() {

		PredicateEntityProperty obj = null;

		try {
			obj = (PredicateEntityProperty) super.clone();
		} catch (CloneNotSupportedException e) {
			throw new RuntimeException(e);
		}

		obj.entity = this.entity;
		obj.property = this.property;

		return obj;
	}
}
